import request from '@/util/request'

const timeout = 60 * 1000

export function insertLinkageToDevice(data) {
  return request({
    url: '/iot/device/linkage/insertToDevice',
    method: 'post',
    timeout: timeout,
    data
  })
}

export function updateLinkageToDevice(data) {
  return request({
    url: '/iot/device/linkage/updateToDevice',
    method: 'post',
    timeout: timeout,
    data
  })
}

export function deleteLinkageToDevice(data) {
  return request({
    url: '/iot/device/linkage/deleteToDevice',
    method: 'post',
    timeout: timeout,
    data
  })
}

export function deleteLinkageByDeviceToDevice(data) {
  return request({
    url: '/iot/device/linkage/deleteByDeviceToDevice',
    method: 'post',
    timeout: timeout,
    data
  })
}

export function insertLinkageToServer(data) {
  return request({
    url: '/iot/device/linkage/insertToServer',
    method: 'post',
    data
  })
}

export function updateLinkageToServer(data) {
  return request({
    url: '/iot/device/linkage/updateToServer',
    method: 'post',
    data
  })
}

export function deleteLinkageToServer(data) {
  return request({
    url: '/iot/device/linkage/deleteToServer',
    method: 'post',
    data
  })
}

export function deleteLinkageByDeviceToServer(data) {
  return request({
    url: '/iot/device/linkage/deleteByDeviceToServer',
    method: 'post',
    data
  })
}

export function listLinkage(data) {
  return request({
    url: '/iot/device/linkage/list',
    method: 'post',
    data
  })
}

export function getWith(data) {
  return request({
    url: '/iot/device/linkage/getWith',
    method: 'post',
    data
  })
}

export function updateLinkage(data) {
  return request({
    url: '/iot/device/linkage/update',
    method: 'post',
    data
  })
}
